package com.xli.mis.tablestruct.entity.dto;

import com.xli.dto.validation.group.IGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;


@Data
public class TableStructDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 3385461775058599742L;

    @Schema(description = "SQL表ID")
    @NotNull(message = "tableId必填", groups = {IGroup.add.class, IGroup.update.class})
    private String tableId;

    @Schema(description = "英文字段名")
    @NotBlank(message = "fieldNameEn必填", groups = {IGroup.add.class, IGroup.update.class})
    private String fieldNameEn;

    @Schema(description = "中文字段名")
    @NotBlank(message = "fieldNameCn必填", groups = {IGroup.add.class, IGroup.update.class})
    private String fieldNameCn;

    @Schema(description = "字段类型")
    @NotBlank(message = "fieldType必填", groups = {IGroup.add.class, IGroup.update.class})
    private String fieldType;

    @Schema(description = "控件类型")
    @NotBlank(message = "controlType必填", groups = {IGroup.add.class, IGroup.update.class})
    private String controlType;

    @Schema(description = "字段长度")
    private Integer fieldLength;

    @Schema(description = "不允许null")
    private String notnull;

    @Schema(description = "关联字典")
    private String codeId;

    @Schema(description = "列表展示")
    private String showInTable;

    @Schema(description = "详情展示")
    private String showInDetail;

    @Schema(description = "搜索展示")
    private String showInSearch;

    @Schema(description = "排序")
    private Integer orderNum;
}
